package com.itheima.stock.job;

import com.itheima.stock.service.StockTimerTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class StockJob {
    @Autowired
    StockTimerTaskService service;

    private static Logger logger = LoggerFactory.getLogger(StockJob.class);

    @XxlJob("job_test")
    public void test1(){
        System.out.println("run..");
    }

    //大盘数据获取
    @XxlJob("getMarketInfos")
    public void getStockMarketInfos(){
        service.getInnerMarketInfos();
    }
    //个股数据读取
    @XxlJob("getStockInfos")
    public void getStockInfos(){
        service.getStockRtIndex();
    }
    //板块数据读取
    @XxlJob("getBlockInfos")
    public void getBlockInfos(){
        service.getStockBlockInfo();
    }


    public void init(){
        System.out.println("init");
    }  public void destory(){
        System.out.println("destory");
    }



}
